{include file="public/header" /}

<body class="gray-bg">
<div class="wrapper wrapper-content">
    <div class="row">
        <form class="form-horizontal" method="post">
            <div class="col-sm-12">
                <div class="tabs-container">
                    <ul class="nav nav-tabs">
                        <li class="active"><a data-toggle="tab" href="#tab-1" aria-expanded="true">基本</a></li>
                        <li class=""><a data-toggle="tab" href="#tab-2" aria-expanded="false">状态</a></li>
                        <li class=""><a data-toggle="tab" href="#tab-3" aria-expanded="false">资料</a></li>
                        <li class=""><a data-toggle="tab" href="#tab-4" aria-expanded="false">额外</a></li>
                        <li class=""><a data-toggle="tab" href="#tab-5" aria-expanded="false">数据</a></li>
                        <li class=""><a data-toggle="tab" href="#tab-8" aria-expanded="false">收款账户</a></li>
                        <li class=""><a data-toggle="tab" href="#tab-9" aria-expanded="false">微信绑定</a></li>
                        <li class=""><a data-toggle="tab" href="#tab-10" aria-expanded="false">设备信息</a></li>
                        {present name='name'}
                        <li class=""><a data-toggle="tab" href="#tab-6" aria-expanded="false">历史数据</a></li>
                        {if condition='$name.delete_time'}
                        <li class=""><a data-toggle="tab" href="#tab-7" aria-expanded="false">注销信息</a></li>
                        {/if}
                        {/present}
                    </ul>
                    <div class="tab-content">
                        <div id="tab-1" class="tab-pane active">
                            <div class="ibox-content">
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">城市：</label>
                                    <div class="col-sm-9">
                                        <?php $getcity = input('get.city');?>
                                        <a href="{:url('location', ['action' => 'add'])}?id={present name='name'}{$name.id}{/present}"><input name="city" type="text"  class="form-control"  placeholder="点击获取地址" value="{if condition='$getcity'}{$getcity}{else /}{present name="name"}{$name.city}{else /}{/present}{/if}"></a>
                                        <input type="hidden" name="longitude" value="{:input('get.longitude')}">
                                        <input type="hidden" name="latitude" value="{:input('get.latitude')}">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">头像：</label>
                                    <div class="col-sm-9">
                                        <div class="input-group">
                                            {php}
                                            $noHttp = isset($name['head_portrait']) && strpos($name['head_portrait'], 'https://') === false;
                                            {/php}
                                            <img src="{present name='name.head_portrait'}{if condition='$name.head_portrait'}{php} if ($noHttp) {echo '__ROOT__';} {/php}{$name.head_portrait}{else /}__IMG__add_img.png{/if}{else /}__IMG__add_img.png{/present}" id="imageimg" style="max-width: 200px">
                                            <input name="head_portrait" type="hidden"  id="image" class="form-control" value="{present name='name'}{$name.head_portrait}{/present}">
                                            {present name="name"}
                                            {eq name="name.real_avatar" value="0"}
                                            <button style="margin-left: 30px;" type="button" class="btn btn-primary" onclick="setRealAvatar('{$name.id}', 1)">设为真人头像</button>
                                            {else}
                                            <button style="margin-left: 30px;" type="button" class="btn btn-danger" onclick="setRealAvatar('{$name.id}', 0)">取消真人头像</button>
                                            {/eq}
                                            {/present}
                                            <span class="input-group-btn">
                                                <button type="button" class="btn btn-primary" id="tubiao">上传</button>
                                            </span>
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">昵称：</label>
                                    <div class="col-sm-9">
                                        <input name="name" type="text"  class="form-control" value="{present name="name"}{$name.name}{/present}">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">密码：</label>
                                    <div class="col-sm-9">
                                        <input name="password" type="text"  class="form-control" value="" placeholder="不填写默认为原密码">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">提现密码：</label>
                                    <div class="col-sm-9">
                                        <input name="paypwd" type="number"  class="form-control" value="" placeholder="不填写默认为原密码">
                                    </div>
                                </div>{eq name='admin.type' value='1'}
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">手机：</label>
                                    <div class="col-sm-9">
                                        <input onkeyup="value=value.replace(/\D/g,'')" name="phone" type="text"  class="form-control" value="{present name='name'}{$name.phone}{/present}">
                                    </div>
                                </div>{/eq}
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">性别：</label>
                                    <div class="col-sm-9">
                                        <select class="form-control" name="sex" onchange="chan(this);">
                                            <option value="男" {present name="name"}{eq name="name.sex" value="男"}selected="selected"{/eq}{/present}>男</option>
                                            <option value="女" {present name="name"}{eq name="name.sex" value="女"}selected="selected"{/eq}{/present}>女</option>
                                        </select>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">角色：</label>
                                    <div class="col-sm-9">
                                        <select class="form-control" name="entertainment" onchange="rolechange(this.value)">
                                            {volist name="user_entertainment" id="entertainment"}
                                            {eq name="entertainment.parent_id" value="0"}
                                            <option value="{$entertainment.role_type}" {present name="name"}{if condition="$name.entertainment == $entertainment.role_type"}selected="selected"{/if}{/present}>{$entertainment.name}</option>
                                            {/eq}
                                            {/volist}
                                        </select>
                                    </div>
                                </div>
                                <div id="role">
                                    
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">生日：</label>
                                    <div class="col-sm-9">
                                        <input name="birthday" type="date"  class="form-control" value="{present name='name'}{$name.birthday}{/present}">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">年龄：</label>
                                    <div class="col-sm-9">
                                        <input name="age" type="number"  class="form-control" value="{present name='name'}{$name.age}{/present}">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">排序：</label>
                                    <div class="col-sm-9">
                                        <input name="sort" type="number"  class="form-control" value="{present name='name'}{$name.sort}{/present}">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">邀请码：</label>
                                    <div class="col-sm-9">
                                        <input type="text" readonly class="form-control" value="{present name='name'}{$name.yqm}{/present}">
                                    </div>
                                </div>
                                {notpresent name="name"}
                                {eq name='$xuni' value='1'}
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">人数：</label>
                                    <div class="col-sm-9">
                                        <input name="userNum" type="text"  class="form-control" value="1" placeholder="批量添加人数">
                                    </div>
                                </div>
                                {/eq}
                                {/notpresent}
                            </div>
                        </div>
                        <div id="tab-2" class="tab-pane">
                            <div class="ibox-content">

                                <!-- <div class="form-group">
                                    <label class="col-sm-2 control-label">代理：</label>
                                    <div class="col-sm-9">
                                        <div class="radio i-checks">
                                            <label>
                                                <input type="radio" value="0" name="proxy" {present name="name"}{eq name="name.proxy" value="0"}checked{/eq}{else /}checked{/present}>否
                                            </label>
                                            <label>
                                                <input type="radio" value="1" name="proxy" {present name="name"}{eq name="name.proxy" value="1"}checked{/eq}{/present}>是
                                            </label>
                                        </div>
                                    </div>
                                </div> -->
                                <!--<div class="form-group">
                                    <label class="col-sm-2 control-label">女神：</label>
                                    <div class="col-sm-9">
                                        <div class="radio i-checks">
                                            <label>
                                                <input type="radio" value="0" name="nvshen" {present name="name"}{eq name="name.nvshen" value="0"}checked{/eq}{else /}checked{/present}>否
                                            </label>
                                            <label>
                                                <input type="radio" value="1" name="nvshen" {present name="name"}{eq name="name.nvshen" value="1"}checked{/eq}{/present}>是
                                            </label>
                                        </div>
                                    </div>
                                </div>-->
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">首页隐藏：</label>
                                    <div class="col-sm-9">
                                        <div class="radio i-checks">
                                            <label>
                                                <input type="radio" value="0" name="home_hidden" {present name="name"}{eq name="name.home_hidden" value="0"}checked{/eq}{else /}checked{/present}>否
                                            </label>
                                            <label>
                                                <input type="radio" value="1" name="home_hidden" {present name="name"}{eq name="name.home_hidden" value="1"}checked{/eq}{/present}>是
                                            </label>
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">首页推荐：</label>
                                    <div class="col-sm-9">
                                        <div class="radio i-checks">
                                            <label>
                                                <input type="radio" value="0" name="is_recommend" {present name="name"}{eq name="name.is_recommend" value="0"}checked{/eq}{else /}checked{/present}>否
                                            </label>
                                            <label>
                                                <input type="radio" value="1" name="is_recommend" {present name="name"}{eq name="name.is_recommend" value="1"}checked{/eq}{/present}>是
                                            </label>
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">不限城市：</label>
                                    <div class="col-sm-9">
                                        <div class="radio i-checks">
                                            <label>
                                                <input type="radio" value="0" name="notlimit_city" {present name="name"}{eq name="name.notlimit_city" value="0"}checked{/eq}{else /}checked{/present}>否
                                            </label>
                                            <label>
                                                <input type="radio" value="1" name="notlimit_city" {present name="name"}{eq name="name.notlimit_city" value="1"}checked{/eq}{/present}>是
                                            </label>
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">少数民族：</label>
                                    <div class="col-sm-9">
                                        <div class="radio i-checks">
                                            <label>
                                                <input type="radio" value="0" name="nation" {present name="name"}{eq name="name.nation" value="0"}checked{/eq}{else /}checked{/present}>否
                                            </label>
                                            <label>
                                                <input type="radio" value="1" name="nation" {present name="name"}{eq name="name.nation" value="1"}checked{/eq}{/present}>是
                                            </label>
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">私密空间：</label>
                                    <div class="col-sm-9">
                                        <div class="radio i-checks">
                                            <label>
                                                <input type="radio" value="0" name="hide_search" {present name="name"}{eq name="name.hide_search" value="0"}checked{/eq}{else /}checked{/present}>关闭
                                            </label>
                                            <label>
                                                <input type="radio" value="1" name="hide_search" {present name="name"}{eq name="name.hide_search" value="1"}checked{/eq}{/present}>开启
                                            </label>
                                        </div>
                                    </div>
                                </div>
                                <!--<div class="form-group">
                                    <label class="col-sm-2 control-label">社交账号：</label>
                                    <div class="col-sm-9">
                                        <div class="radio i-checks">
                                            <label>
                                                <input type="radio" value="0" name="kejian" {present name="name"}{eq name="name.kejian" value="0"}checked{/eq}{else /}checked{/present}>隐藏
                                            </label>
                                            <label>
                                                <input type="radio" value="1" name="kejian" {present name="name"}{eq name="name.kejian" value="1"}checked{/eq}{/present}>可见
                                            </label>
                                        </div>
                                    </div>
                                </div>-->
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">登陆状态：</label>
                                    <div class="col-sm-9">
                                        <div class="radio i-checks">
                                            <label>
                                                <input type="radio" value="0" name="is_online" {present name="name"}{eq name="name.is_online" value="0"}checked{else /}checked{/eq}{else /}checked{/present}>离线
                                            </label>
                                            <label>
                                                <input type="radio" value="1" name="is_online" {present name="name"}{eq name="name.is_online" value="1"}checked{/eq}{/present}>在线
                                            </label>
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">账号状态：</label>
                                    <div class="col-sm-9">
                                        <div class="radio i-checks">
                                            <label>
                                                <input type="radio" value="0" name="is_banned" {present name="name"}{eq name="name.is_banned" value="0"}checked{/eq}{else /}checked{/present}>正常
                                            </label>
                                            <label>
                                                <input type="radio" value="1" name="is_banned" {present name="name"}{eq name="name.is_banned" value="1"}checked{/eq}{/present}>冻结
                                            </label>
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">冻结时间：</label>
                                    <div class="col-sm-9">
                                        <input name="banned_end_time" type="text" id="time" class="form-control layui-input" value="{present name='name'}{$name.banned_end_time}{/present}" autocomplete="off"  style="width: 30%;float: left;">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">冻结原因：</label>
                                    <div class="col-sm-9">
                                        <input name="banned_desc" type="text"  class="form-control" placeholder="" value="{present name="name"}{$name.banned_desc}{/present}">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">虚拟距离：</label>
                                    <div class="col-sm-9">
                                        <input name="xuni_discount" type="text"  class="form-control" placeholder="单位:m" value="{present name="name"}{if condition='($name.xuni_discount + 0)'}{$name.xuni_discount}{/if}{/present}">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">设备号：</label>
                                    <div class="col-sm-9">
                                        <input name="device_id" type="text" class="form-control" value="{present name='name'}{$name.device_id}{/present}">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">最后刷新在线时间：</label>
                                    <div class="col-sm-9">
                                        <input type="text" readonly class="form-control layui-input" value="{present name='name'}{$name.last_login_datetime}{/present}" autocomplete="off"  style="width: 30%;float: left;">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">最后登录时间：</label>
                                    <div class="col-sm-9">
                                        <input type="text" readonly class="form-control layui-input" value="{present name='name'}{$name.last_login_time|date='Y-m-d H:i:s', ###}{/present}" autocomplete="off"  style="width: 30%;float: left;">
                                        {present name='name'}
                                            <button style="margin-left: 30px;" type="button" class="btn btn-primary" onclick="refreshLoginTIme('{$name.id}')">刷新</button>
                                            <button style="margin-left: 30px;" type="button" class="btn btn-primary" onclick="refreshLoginTIme('{$name.id}', 1)">+1秒</button>
                                        {/present}
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">上级邀请码：</label>
                                    <div class="col-sm-9">
                                        <input type="text" readonly class="form-control layui-input" value="{present name='name'}{$name.yqr}{/present}" autocomplete="off"  style="width: 30%;float: left;">
                                    </div>
                                </div>
                                {present name='name'}
                                {if condition='$name.delete_time'}
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">注销时间：</label>
                                    <div class="col-sm-9">
                                        <input type="text" readonly class="form-control layui-input" value="{:date('Y-m-d H:i:s', $name.delete_time)}" autocomplete="off"  style="width: 30%;float: left;">
                                    </div>
                                </div>
                                {/if}
                                {/present}
                            </div>
                        </div>
                        <div id="tab-3" class="tab-pane">
                            <div class="ibox-content">
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">经度：</label>
                                    <div class="col-sm-9">
                                        <input name="longitude" type="number" class="form-control" value="{present name='name'}{$name.longitude}{/present}" placeholder="单位:kg">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">纬度：</label>
                                    <div class="col-sm-9">
                                        <input name="latitude" type="number" class="form-control" value="{present name='name'}{$name.latitude}{/present}" placeholder="单位:kg">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">认证：</label>
                                    <div class="col-sm-9">
                                        <input name="auth_tag" type="text" class="form-control" placeholder="如：知名 XXX 博主" value="{present name='name'}{$name.auth_tag}{/present}">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">情感：</label>
                                    <div class="col-sm-9">
                                        <select class="form-control" name="emotion">
                                            <option value=""></option>
                                            <option value="单身" {present name="name"}{eq name="name.emotion" value="单身"}selected="selected"{/eq}{/present}>单身</option>
                                            <option value="恋爱中" {present name="name"}{eq name="name.emotion" value="恋爱中"}selected="selected"{/eq}{/present}>恋爱中</option>
                                            <option value="离异" {present name="name"}{eq name="name.emotion" value="离异"}selected="selected"{/eq}{/present}>离异</option>
                                            <option value="丧偶" {present name="name"}{eq name="name.emotion" value="丧偶"}selected="selected"{/eq}{/present}>丧偶</option>
                                            <option value="已婚" {present name="name"}{eq name="name.emotion" value="已婚"}selected="selected"{/eq}{/present}>已婚</option>
                                            <option value="保密" {present name="name"}{eq name="name.emotion" value="保密"}selected="selected"{/eq}{/present}>保密</option>
                                        </select>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">学历：</label>
                                    <div class="col-sm-9">
                                        <select class="form-control" name="education_background">
                                            <option value=""></option>
                                            <option value="初中" {present name="name"}{eq name="name.education_background" value="初中"}selected="selected"{/eq}{/present}>初中</option>
                                            <option value="中专" {present name="name"}{eq name="name.education_background" value="中专"}selected="selected"{/eq}{/present}>中专</option>
                                            <option value="高中" {present name="name"}{eq name="name.education_background" value="高中"}selected="selected"{/eq}{/present}>高中</option>
                                            <option value="大专" {present name="name"}{eq name="name.education_background" value="大专"}selected="selected"{/eq}{/present}>大专</option>
                                            <option value="本科" {present name="name"}{eq name="name.education_background" value="本科"}selected="selected"{/eq}{/present}>本科</option>
                                            <option value="双学士" {present name="name"}{eq name="name.education_background" value="双学士"}selected="selected"{/eq}{/present}>双学士</option>
                                            <option value="硕士" {present name="name"}{eq name="name.education_background" value="硕士"}selected="selected"{/eq}{/present}>硕士</option>
                                            <option value="博士" {present name="name"}{eq name="name.education_background" value="博士"}selected="selected"{/eq}{/present}>博士</option>
                                        </select>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">职业：</label>
                                    <div class="col-sm-9">
                                        <select class="form-control" name="occupation">
                                            {volist name='occupation' id='vv'}
                                            <label>
                                                <option name="occupation[]" value="{$vv.name}" {present name="name"}{eq name="name.occupation" value="$vv.name"}selected="selected"{/eq}{/present}>{$vv.name}</option>
                                            </label>
                                            {/volist}
                                        </select>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">微信：</label>
                                    <div class="col-sm-9">
                                        <input name="wxcount" type="text" class="form-control" value="{present name='name'}{$name.wxcount}{/present}">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">身高：</label>
                                    <div class="col-sm-9">
                                        <input name="stature" type="number" class="form-control" value="{present name='name'}{$name.stature}{/present}" placeholder="单位:cm">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">体重：</label>
                                    <div class="col-sm-9">
                                        <input name="weight" type="number" class="form-control" value="{present name='name'}{$name.weight}{/present}" placeholder="单位:kg">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">签名：</label>
                                    <div class="col-sm-9">
                                        <textarea class="form-control" name="slogan">{present name="name"}{$name.slogan}{/present}</textarea>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">介绍：</label>
                                    <div class="col-sm-9">
                                        <textarea class="form-control" name="self_slogan">{present name="name"}{$name.self_slogan}{/present}</textarea>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">擅长标签：</label>
                                    <div class="col-sm-9">
                                        <div class="radio i-checks">
                                            {volist name='labels' id='v'}
                                            <label>
                                                <input type="checkbox" name="good_label[]" value="{$v.id}" {present name="name"}{if condition='in_array($v.id, $name.good_label)'}checked="checked"{/if}{/present}>{$v.name}
                                            </label>
                                            {/volist}
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">兴趣标签：</label>
                                    <div class="col-sm-9">
                                        <div class="radio i-checks">
                                            {volist name='labels' id='v'}
                                            <label>
                                                <input type="checkbox" name="interested_label[]" value="{$v.id}" {present name="name"}{if condition='in_array($v.id, $name.interested_label)'}checked="checked"{/if}{/present}>{$v.name}
                                            </label>
                                            {/volist}
                                        </div>
                                    </div>
                                </div>
                                </div>
                           </div>
                        <div id="tab-4" class="tab-pane">
                            <div class="ibox-content">
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">魅力值：</label>
                                    <div class="col-sm-9">
                                        <input name="charm_value" type="number" class="form-control" value="{present name='name'}{$name.charm_value}{/present}">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">土豪值：</label>
                                    <div class="col-sm-9">
                                        <input name="tycoon" type="number" class="form-control" value="{present name='name'}{$name.tycoon}{/present}">
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label class="col-sm-2 control-label">免费私信条数：</label>
                                    <div class="col-sm-9">
                                        <input name="free_chat" type="number" class="form-control" value="{present name='name'}{$name.free_chat}{/present}">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">免费音频分钟数：</label>
                                    <div class="col-sm-9">
                                        <input name="free_voice" type="number" class="form-control" value="{present name='name'}{$name.free_voice}{/present}">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">免费视频分钟数：</label>
                                    <div class="col-sm-9">
                                        <input name="free_video" type="number" class="form-control" value="{present name='name'}{$name.free_video}{/present}">
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div id="tab-5" class="tab-pane">
                            <div class="ibox-content">
                                {present name="name"}
                                <?php $parent = db('user')->where(['yqm' => $name['yqr']])->find(); ?>
                                {else /}
                                <?php $parent = ''; ?>
                                {/present}
                                {if condition='!isset($id) || !$parent || !$name.yqr || isset($proxys[$name.yqr])'}
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">所属代理：</label>
                                    <div class="col-sm-9">
                                        <select class="form-control" name="yqr">
                                            <option value=""></option>
                                            {volist name='proxys' id='v'}
                                                <option value="{$v.yqm}" {present name="name"}{eq name="name.yqr" value="$v.yqm"}selected="selected"{/eq}{/present}>{$v.name}</option>
                                            {/volist}
                                        </select>
                                    </div>
                                </div>
                                {/if}
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">已获得抽奖次数：</label>
                                    <div class="col-sm-9">
                                        <input disabled class="form-control" value="{present name='name'}{$name.topup_reward}{/present}">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">抽奖次数：</label>
                                    <div class="col-sm-9">
                                        <input name="lottery_count" type="number" class="form-control" value="{present name='name'}{$name.lottery_count}{/present}">
                                    </div>
                                </div>
                                <!--<div class="form-group">
                                    <label class="col-sm-2 control-label">分成 (%)：</label>
                                    <div class="col-sm-9">
                                        <input name="fencheng_user" type="number" class="form-control" value="{present name='name'}{$name.fencheng_user * 100}{/present}">
                                    </div>
                                </div>-->
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">虚拟收益：</label>
                                    <div class="col-sm-9">
                                        <input name="shouyi_xuni" type="number" class="form-control" value="{present name='name'}{$name.shouyi_xuni}{/present}">
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div id="tab-6" class="tab-pane">
                            <blockquote class="layui-elem-quote">历史数据不代表当前数据。双击可快速复制</blockquote>

                            <div class="ibox-content">
                                {present name="name"}
                                {if condition="isset($name.otherdata)"}
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">设备号：</label>
                                    <div class="col-sm-9">
                                        {volist name="$name.otherdata.device_ids" id="devices"}
                                        <input readonly id="devices{$key}" onclick="handleFlowCopy('devices{$key}')" data-clipboard-text="{$devices}" class="form-control devices" value="{$devices}">
                                        {/volist}
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">收款信息：</label>
                                    <div class="col-sm-9">
                                        {volist name="$name.otherdata.zhifucounts" id="zhifucounts"}
                                        <input readonly id="zhifucounts{$key}" onclick="handleFlowCopy('zhifucounts{$key}')" data-clipboard-text="{$zhifucounts}" class="form-control zhifucounts" value="{$zhifucounts}">
                                        {/volist}
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">IP：</label>
                                    <div class="col-sm-9">
                                        {volist name="$name.otherdata.ips" id="ips"}
                                        <input readonly id="ips{$key}" onclick="handleFlowCopy('ips{$key}')" data-clipboard-text="{$ips}" class="form-control ips" value="{$ips}">
                                        {/volist}
                                    </div>
                                </div>
                                
                                {if condition="$name.admin_type ==1"}
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">实名认证图：</label>
                                    <div class="col-sm-7">
                                        {volist name="$name.otherdata.idcards" id="idcards"}
                                            {php}
                                            $idcards = strpos($idcards, 'http') === false ? '__ROOT__' . $idcards : $idcards;
                                            {/php}
                                        <img width="300" height="160" onclick="showpic('{$idcards}')" src="{$idcards}" style="background: #f3f3f3; margin-bottom: 10px; object-fit: contain;" />
                                        {/volist}
                                    </div>
                                </div>
                                {/if}
                                {/if}
                                {/present}
                            </div>
                        </div>
                        <div id="tab-7" class="tab-pane">
                            <blockquote class="layui-elem-quote">注销成功前的账号资料</blockquote>
                            <div class="ibox-content">
                                {present name="name"}
                                {if condition="isset($name.recycleData)"}
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">手机号：</label>
                                    <div class="col-sm-9">
                                        {present name="$name.recycleData.phone"}
                                        <input readonly id="phone" onclick="handleFlowCopy('phone')" data-clipboard-text="{$name.recycleData.phone}" class="form-control phone" value="{$name.recycleData.phone}">
                                        {/present}
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">收款人名称：</label>
                                    <div class="col-sm-9">
                                        {present name="$name.recycleData.zhifuname"}
                                        <input readonly id="zhifuname" onclick="handleFlowCopy('zhifuname')" data-clipboard-text="{$name.recycleData.zhifuname}" class="form-control zhifuname" value="{$name.recycleData.zhifuname}">
                                        {/present}
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">收款支付宝：</label>
                                    <div class="col-sm-9">
                                        {present name="$name.recycleData.zhifucount"}
                                        <input readonly id="zhifucount" onclick="handleFlowCopy('zhifucount')" data-clipboard-text="{$name.recycleData.zhifucount}" class="form-control zhifucount" value="{$name.recycleData.zhifucount}">
                                        {/present}
                                    </div>
                                </div>
                                {/if}
                                {/present}
                            </div>
                        </div>
                        <div id="tab-8" class="tab-pane">
                            <div class="ibox-content">
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">收款名称：</label>
                                    <div class="col-sm-9">
                                        <input type="text" readonly class="form-control" value="{present name="name"}{$name.zhifuname}{/present}">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">收款支付宝：</label>
                                    <div class="col-sm-9">
                                        <input type="text" readonly class="form-control" value="{present name="name"}{$name.zhifucount}{/present}">
                                    </div>
                                </div>

                                {if condition="$admin['type'] == 1"}
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">操作：</label>
                                    <div class="col-sm-9">
                                        <div class="btn btn-primary" onclick="clearaccount({present name="name"}{$name.id}{/present})">清空</div>
                                    </div>
                                </div>
                                {/if}
                            </div>
                        </div>
                        <div id="tab-9" class="tab-pane">
                            <div class="ibox-content">
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">开放平台UNION_ID：</label>
                                    <div class="col-sm-9">
                                        <input type="text" readonly class="form-control" value="{present name="name"}{$name.wechatInfo.unionid}{/present}">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">移动应用(APP) Openid：</label>
                                    <div class="col-sm-9">
                                        <input type="text" readonly class="form-control" value="{present name="name"}{$name.wechatInfo.wxapp_openid}{/present}">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">公众号Openid：</label>
                                    <div class="col-sm-9">
                                        <input type="text" readonly class="form-control" value="{present name="name"}{$name.wechatInfo.wxgzh_openid}{/present}">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">微信昵称：</label>
                                    <div class="col-sm-9">
                                        <input type="text" readonly class="form-control" value="{present name="name"}{$name.wechat_name}{/present}">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">操作：</label>
                                    <div class="col-sm-9">
                                        <div class="btn btn-primary" onclick="clearaccount({present name="name"}{$name.id}{/present}, 1)">清空</div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div id="tab-10" class="tab-pane">
                            <div class="ibox-content">
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">当前APP：</label>
                                    <div class="col-sm-9">
                                        {php}
                                        $app = ['','那蓝之恋','',''];
                                        {/php}
                                        {if condition="isset($name) && isset($name['otherdata'])"}
                                        <input type="text" readonly class="form-control" value="{$app[$name.otherdata.sys_channel]}">
                                        {/if}
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">APP版本：</label>
                                    <div class="col-sm-9">
                                        {if condition="isset($name) && isset($name['otherdata'])"}
                                        <input type="text" readonly class="form-control" value="{$name.otherdata.last_login_app_version}">
                                        {/if}
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">版本信息：</label>
                                    <div class="col-sm-9">
                                        {if condition="isset($name)"}
                                        <input type="textarea" readonly class="form-control" value="{$name.wxname}">
                                        {/if}
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">手机信息：</label>
                                    <div class="col-sm-9">
                                        {if condition="isset($name) && isset($name['otherdata'])"}
                                        <input type="textarea" readonly class="form-control" value="{$name.otherdata.os}">
                                        {/if}
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">手机型号：</label>
                                    <div class="col-sm-9">
                                        {if condition="isset($name) && isset($name['otherdata'])"}
                                        <input type="textarea" readonly class="form-control" value="{$name.otherdata.device_brand}">
                                        {/if}
                                    </div>
                                </div>
                                        {if condition="isset($name) && isset($name['accessibility'])"}
                                {volist name="$name['accessibility']" id="device"}
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">设备无障碍包名：</label>
                                    <div class="col-sm-9">
                                        <input type="textarea" readonly class="form-control" value="{$device.accessibility}">
                                    </div>
                                </div>
                                {/volist}
                                        {/if}
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </form>
    </div>
</div>
{include file="public/footer" /}
{load href="__PLUGINS__iCheck/icheck.min.js"}
{load href="__PLUGINS__iCheck/custom.css"}
{load href="__JS__/clipboard.min.js"}
<script type="text/javascript">
    $(document).ready(function(){
        $(".i-checks").iCheck({
            checkboxClass: "icheckbox_square-green",
            radioClass: "iradio_square-green",
        })

        layui.use('laydate', function () {
            var laydate = layui.laydate;

            //执行一个laydate实例
            laydate.render ({
                elem : '#time', //指定元素
                type : 'datetime',
                trigger: 'click'
            });
        });


    })

    function chan(obj) {
        if ($(obj).val()=='男') {
            $('.conditions_man').show().siblings().hide();
            $('.conditions_woman').find('input').removeAttr('checked');
        } else if($(obj).val()=='女') {
            $('.conditions_woman').show().siblings().hide();
            $('.conditions_man').find('input').removeAttr('checked');
        }
    }

    function handleFlowCopy(id) {
        // 根据当前id动态生成不同实例
        var streamurl = new ClipboardJS(document.getElementById(id));
        streamurl.on('success', (e) => {
            layer.msg('复制成功')
        });
    }
    function clearaccount(id, type = 0){
        layer.open({
            content: '确认 清空ID：' + id + (type?' 的微信绑定信息？':' 的收款信息？'),
            yes: function(index, layero){
                layer.close(index);
                $.ajax({
                    type: 'post',
                    url: '{:url("clearaccount")}',
                    data: {id, type},
                    dataType: 'json',
                    success:function(ret){
                        if (ret.ret) {
                            layer.msg('清空成功')
                            window.location.reload()
                        } else {
                            layer.msg(ret.err);
                        }

                    },
                    error:function(err){
                        layer.msg(err)
                    }
                });
            }
        });
    }

    function showpic(pic) {
        window.open(pic)
    }

    function setRealAvatar(id, state) {
        $.ajax({
            type: 'post',
            url: '{:url("setRealAvatar")}',
            data: {id, state},
            dataType: 'json',
            success:function(ret){
                if (ret.ret) {
                    window.location.reload()
                } else {
                    layer.msg(ret.err);
                }

            },
            error:function(err){
                layer.msg(err)
            }
        });
    }

    function refreshLoginTIme(id, t = 0) {
        $.ajax({
            type: 'post',
            url: '{:url("refreshLoginTIme")}',
            data: {id, t},
            dataType: 'json',
            success:function(ret){
                if (ret.ret) {
                    window.location.reload()
                } else {
                    layer.msg(ret.err);
                }

            },
            error:function(err){
                layer.msg(err)
            }
        });
    }
    var roles = JSON.parse('{:json_encode($user_entertainment)}');
    function rolechange(v) {
        let role = roles.filter(item => item.parent_id == v+1);
        html = '';
        if (role.length) {
            html = `
            <div class="form-group">
                <label class="col-sm-2 control-label">角色子项：</label>
                <div class="col-sm-9">
                    <div class="radio i-checks">`

            for (var i = 0; i < role.length; i++) {
                html += `<label>
                            <input type="checkbox" id="entertainment_child${role[i].id - 1}" name="entertainment_child[]" value="${role[i].id - 1}">${role[i].name}</
                        </label>`
            }


            html += `</div>
                </div>
            </div>`

        }
        $('#role').html(html)


        $(".i-checks").iCheck({
            checkboxClass: "icheckbox_square-green",
            radioClass: "iradio_square-green",
        })
    }
    rolechange("<?php echo isset($name)?$name['entertainment']:0; ?>")
    setTimeout(()=>{
        let role_child = "<?php echo isset($name)?$name['entertainment_child']:''; ?>";
        if (role_child) {
            role_child = role_child.split(',')
            role_child.forEach(item=>{
                console.log(item)
                $("#entertainment_child"+item).attr('checked', true);
                
        $(".i-checks").iCheck({
            checkboxClass: "icheckbox_square-green",
            radioClass: "iradio_square-green",
        })
            })
        }
    },500)
</script>

{include file="public/bottom" /}
 
